home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
CFUNCTS.LZH
/
POKE.C
< prev
next >
Wrap
Text File
|
1987-01-22
|
2KB
|
40 lines
/*
===================================================================
P O K E F U N C T I O N
===================================================================
This function will poke a value into a screen memory
location. It is passed the row and column and the
desired value to poke. It will then calculate the
address of the screen location and then store the
value at that address.
-----------------------------------------------------------------*/
poke(row,col,val)
int row, col;
char val;
{
char far *loc; /* memory location pointer. */
int card_type; /* card type? */
int position; /* cursor position. */
card_type = card();
if(card_type == 1){ /* IBM Color Card. */
loc = (char far *)0xb8000000;
}
else{ /* Monochrome card. */
loc = (char far *)0xb0000000;
}
/* Determine cursor position. */
position = ((row * 80) + col) * 2;
/* Add position to loc. */
loc += position;
/* Store val at loc address. */
*loc++ = val;
*loc = 0x07; /* Normal attribute. */
return(0); /* All done. Let's exit poke(). */
}
/*---------------------------------------------------------------*/